﻿using System;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using HslCommunication.BasicFramework;
using HslCommunication.Core;

namespace HslCommunication.Robot.FANUC
{
	/// <summary>
	/// Fanuc机器人的所有的数据信息
	/// </summary>
	// Token: 0x02000033 RID: 51
	public class FanucData
	{
		// Token: 0x170000AC RID: 172
		// (get) Token: 0x060003B2 RID: 946 RVA: 0x0000ED14 File Offset: 0x0000CF14
		// (set) Token: 0x060003B3 RID: 947 RVA: 0x0000ED1C File Offset: 0x0000CF1C
		public FanucAlarm[] AlarmList { get; set; }

		// Token: 0x170000AD RID: 173
		// (get) Token: 0x060003B4 RID: 948 RVA: 0x0000ED25 File Offset: 0x0000CF25
		// (set) Token: 0x060003B5 RID: 949 RVA: 0x0000ED2D File Offset: 0x0000CF2D
		public FanucAlarm AlarmCurrent { get; set; }

		// Token: 0x170000AE RID: 174
		// (get) Token: 0x060003B6 RID: 950 RVA: 0x0000ED36 File Offset: 0x0000CF36
		// (set) Token: 0x060003B7 RID: 951 RVA: 0x0000ED3E File Offset: 0x0000CF3E
		public FanucAlarm AlarmPassword { get; set; }

		// Token: 0x170000AF RID: 175
		// (get) Token: 0x060003B8 RID: 952 RVA: 0x0000ED47 File Offset: 0x0000CF47
		// (set) Token: 0x060003B9 RID: 953 RVA: 0x0000ED4F File Offset: 0x0000CF4F
		public FanucPose CurrentPose { get; set; }

		// Token: 0x170000B0 RID: 176
		// (get) Token: 0x060003BA RID: 954 RVA: 0x0000ED58 File Offset: 0x0000CF58
		// (set) Token: 0x060003BB RID: 955 RVA: 0x0000ED60 File Offset: 0x0000CF60
		public FanucPose CurrentPoseUF { get; set; }

		// Token: 0x170000B1 RID: 177
		// (get) Token: 0x060003BC RID: 956 RVA: 0x0000ED69 File Offset: 0x0000CF69
		// (set) Token: 0x060003BD RID: 957 RVA: 0x0000ED71 File Offset: 0x0000CF71
		public FanucPose CurrentPose2 { get; set; }

		// Token: 0x170000B2 RID: 178
		// (get) Token: 0x060003BE RID: 958 RVA: 0x0000ED7A File Offset: 0x0000CF7A
		// (set) Token: 0x060003BF RID: 959 RVA: 0x0000ED82 File Offset: 0x0000CF82
		public FanucPose CurrentPose3 { get; set; }

		// Token: 0x170000B3 RID: 179
		// (get) Token: 0x060003C0 RID: 960 RVA: 0x0000ED8B File Offset: 0x0000CF8B
		// (set) Token: 0x060003C1 RID: 961 RVA: 0x0000ED93 File Offset: 0x0000CF93
		public FanucPose CurrentPose4 { get; set; }

		// Token: 0x170000B4 RID: 180
		// (get) Token: 0x060003C2 RID: 962 RVA: 0x0000ED9C File Offset: 0x0000CF9C
		// (set) Token: 0x060003C3 RID: 963 RVA: 0x0000EDA4 File Offset: 0x0000CFA4
		public FanucPose CurrentPose5 { get; set; }

		// Token: 0x170000B5 RID: 181
		// (get) Token: 0x060003C4 RID: 964 RVA: 0x0000EDAD File Offset: 0x0000CFAD
		// (set) Token: 0x060003C5 RID: 965 RVA: 0x0000EDB5 File Offset: 0x0000CFB5
		public FanucTask Task { get; set; }

		// Token: 0x170000B6 RID: 182
		// (get) Token: 0x060003C6 RID: 966 RVA: 0x0000EDBE File Offset: 0x0000CFBE
		// (set) Token: 0x060003C7 RID: 967 RVA: 0x0000EDC6 File Offset: 0x0000CFC6
		public FanucTask TaskIgnoreMacro { get; set; }

		// Token: 0x170000B7 RID: 183
		// (get) Token: 0x060003C8 RID: 968 RVA: 0x0000EDCF File Offset: 0x0000CFCF
		// (set) Token: 0x060003C9 RID: 969 RVA: 0x0000EDD7 File Offset: 0x0000CFD7
		public FanucTask TaskIgnoreKarel { get; set; }

		// Token: 0x170000B8 RID: 184
		// (get) Token: 0x060003CA RID: 970 RVA: 0x0000EDE0 File Offset: 0x0000CFE0
		// (set) Token: 0x060003CB RID: 971 RVA: 0x0000EDE8 File Offset: 0x0000CFE8
		public FanucTask TaskIgnoreMacroKarel { get; set; }

		// Token: 0x170000B9 RID: 185
		// (get) Token: 0x060003CC RID: 972 RVA: 0x0000EDF1 File Offset: 0x0000CFF1
		// (set) Token: 0x060003CD RID: 973 RVA: 0x0000EDF9 File Offset: 0x0000CFF9
		public FanucPose[] PosRegGP1 { get; set; }

		// Token: 0x170000BA RID: 186
		// (get) Token: 0x060003CE RID: 974 RVA: 0x0000EE02 File Offset: 0x0000D002
		// (set) Token: 0x060003CF RID: 975 RVA: 0x0000EE0A File Offset: 0x0000D00A
		public FanucPose[] PosRegGP2 { get; set; }

		// Token: 0x170000BB RID: 187
		// (get) Token: 0x060003D0 RID: 976 RVA: 0x0000EE13 File Offset: 0x0000D013
		// (set) Token: 0x060003D1 RID: 977 RVA: 0x0000EE1B File Offset: 0x0000D01B
		public FanucPose[] PosRegGP3 { get; set; }

		// Token: 0x170000BC RID: 188
		// (get) Token: 0x060003D2 RID: 978 RVA: 0x0000EE24 File Offset: 0x0000D024
		// (set) Token: 0x060003D3 RID: 979 RVA: 0x0000EE2C File Offset: 0x0000D02C
		public FanucPose[] PosRegGP4 { get; set; }

		// Token: 0x170000BD RID: 189
		// (get) Token: 0x060003D4 RID: 980 RVA: 0x0000EE35 File Offset: 0x0000D035
		// (set) Token: 0x060003D5 RID: 981 RVA: 0x0000EE3D File Offset: 0x0000D03D
		public FanucPose[] PosRegGP5 { get; set; }

		// Token: 0x170000BE RID: 190
		// (get) Token: 0x060003D6 RID: 982 RVA: 0x0000EE46 File Offset: 0x0000D046
		// (set) Token: 0x060003D7 RID: 983 RVA: 0x0000EE4E File Offset: 0x0000D04E
		public int FAST_CLOCK { get; set; }

		// Token: 0x170000BF RID: 191
		// (get) Token: 0x060003D8 RID: 984 RVA: 0x0000EE57 File Offset: 0x0000D057
		// (set) Token: 0x060003D9 RID: 985 RVA: 0x0000EE5F File Offset: 0x0000D05F
		public int Timer10_TIMER_VAL { get; set; }

		// Token: 0x170000C0 RID: 192
		// (get) Token: 0x060003DA RID: 986 RVA: 0x0000EE68 File Offset: 0x0000D068
		// (set) Token: 0x060003DB RID: 987 RVA: 0x0000EE70 File Offset: 0x0000D070
		public float MOR_GRP_CURRENT_ANG { get; set; }

		// Token: 0x170000C1 RID: 193
		// (get) Token: 0x060003DC RID: 988 RVA: 0x0000EE79 File Offset: 0x0000D079
		// (set) Token: 0x060003DD RID: 989 RVA: 0x0000EE81 File Offset: 0x0000D081
		public float DUTY_TEMP { get; set; }

		// Token: 0x170000C2 RID: 194
		// (get) Token: 0x060003DE RID: 990 RVA: 0x0000EE8A File Offset: 0x0000D08A
		// (set) Token: 0x060003DF RID: 991 RVA: 0x0000EE92 File Offset: 0x0000D092
		public string TIMER10_COMMENT { get; set; }

		// Token: 0x170000C3 RID: 195
		// (get) Token: 0x060003E0 RID: 992 RVA: 0x0000EE9B File Offset: 0x0000D09B
		// (set) Token: 0x060003E1 RID: 993 RVA: 0x0000EEA3 File Offset: 0x0000D0A3
		public string TIMER2_COMMENT { get; set; }

		// Token: 0x170000C4 RID: 196
		// (get) Token: 0x060003E2 RID: 994 RVA: 0x0000EEAC File Offset: 0x0000D0AC
		// (set) Token: 0x060003E3 RID: 995 RVA: 0x0000EEB4 File Offset: 0x0000D0B4
		public FanucPose MNUTOOL1_1 { get; set; }

		// Token: 0x170000C5 RID: 197
		// (get) Token: 0x060003E4 RID: 996 RVA: 0x0000EEBD File Offset: 0x0000D0BD
		// (set) Token: 0x060003E5 RID: 997 RVA: 0x0000EEC5 File Offset: 0x0000D0C5
		public string HTTPKCL_CMDS { get; set; }

		// Token: 0x170000C6 RID: 198
		// (get) Token: 0x060003E6 RID: 998 RVA: 0x0000EECE File Offset: 0x0000D0CE
		// (set) Token: 0x060003E7 RID: 999 RVA: 0x0000EED6 File Offset: 0x0000D0D6
		public int[] NumReg1 { get; set; }

		// Token: 0x170000C7 RID: 199
		// (get) Token: 0x060003E8 RID: 1000 RVA: 0x0000EEDF File Offset: 0x0000D0DF
		// (set) Token: 0x060003E9 RID: 1001 RVA: 0x0000EEE7 File Offset: 0x0000D0E7
		public float[] NumReg2 { get; set; }

		// Token: 0x170000C8 RID: 200
		// (get) Token: 0x060003EA RID: 1002 RVA: 0x0000EEF0 File Offset: 0x0000D0F0
		// (set) Token: 0x060003EB RID: 1003 RVA: 0x0000EEF8 File Offset: 0x0000D0F8
		public FanucPose[] DataPosRegMG { get; set; }

		// Token: 0x170000C9 RID: 201
		// (get) Token: 0x060003EC RID: 1004 RVA: 0x0000EF01 File Offset: 0x0000D101
		// (set) Token: 0x060003ED RID: 1005 RVA: 0x0000EF09 File Offset: 0x0000D109
		public string[] DIComment { get; set; }

		// Token: 0x170000CA RID: 202
		// (get) Token: 0x060003EE RID: 1006 RVA: 0x0000EF12 File Offset: 0x0000D112
		// (set) Token: 0x060003EF RID: 1007 RVA: 0x0000EF1A File Offset: 0x0000D11A
		public string[] DOComment { get; set; }

		// Token: 0x170000CB RID: 203
		// (get) Token: 0x060003F0 RID: 1008 RVA: 0x0000EF23 File Offset: 0x0000D123
		// (set) Token: 0x060003F1 RID: 1009 RVA: 0x0000EF2B File Offset: 0x0000D12B
		public string[] RIComment { get; set; }

		// Token: 0x170000CC RID: 204
		// (get) Token: 0x060003F2 RID: 1010 RVA: 0x0000EF34 File Offset: 0x0000D134
		// (set) Token: 0x060003F3 RID: 1011 RVA: 0x0000EF3C File Offset: 0x0000D13C
		public string[] ROComment { get; set; }

		// Token: 0x170000CD RID: 205
		// (get) Token: 0x060003F4 RID: 1012 RVA: 0x0000EF45 File Offset: 0x0000D145
		// (set) Token: 0x060003F5 RID: 1013 RVA: 0x0000EF4D File Offset: 0x0000D14D
		public string[] UIComment { get; set; }

		// Token: 0x170000CE RID: 206
		// (get) Token: 0x060003F6 RID: 1014 RVA: 0x0000EF56 File Offset: 0x0000D156
		// (set) Token: 0x060003F7 RID: 1015 RVA: 0x0000EF5E File Offset: 0x0000D15E
		public string[] UOComment { get; set; }

		// Token: 0x170000CF RID: 207
		// (get) Token: 0x060003F8 RID: 1016 RVA: 0x0000EF67 File Offset: 0x0000D167
		// (set) Token: 0x060003F9 RID: 1017 RVA: 0x0000EF6F File Offset: 0x0000D16F
		public string[] SIComment { get; set; }

		// Token: 0x170000D0 RID: 208
		// (get) Token: 0x060003FA RID: 1018 RVA: 0x0000EF78 File Offset: 0x0000D178
		// (set) Token: 0x060003FB RID: 1019 RVA: 0x0000EF80 File Offset: 0x0000D180
		public string[] SOComment { get; set; }

		// Token: 0x170000D1 RID: 209
		// (get) Token: 0x060003FC RID: 1020 RVA: 0x0000EF89 File Offset: 0x0000D189
		// (set) Token: 0x060003FD RID: 1021 RVA: 0x0000EF91 File Offset: 0x0000D191
		public string[] WIComment { get; set; }

		// Token: 0x170000D2 RID: 210
		// (get) Token: 0x060003FE RID: 1022 RVA: 0x0000EF9A File Offset: 0x0000D19A
		// (set) Token: 0x060003FF RID: 1023 RVA: 0x0000EFA2 File Offset: 0x0000D1A2
		public string[] WOComment { get; set; }

		// Token: 0x170000D3 RID: 211
		// (get) Token: 0x06000400 RID: 1024 RVA: 0x0000EFAB File Offset: 0x0000D1AB
		// (set) Token: 0x06000401 RID: 1025 RVA: 0x0000EFB3 File Offset: 0x0000D1B3
		public string[] WSIComment { get; set; }

		// Token: 0x170000D4 RID: 212
		// (get) Token: 0x06000402 RID: 1026 RVA: 0x0000EFBC File Offset: 0x0000D1BC
		// (set) Token: 0x06000403 RID: 1027 RVA: 0x0000EFC4 File Offset: 0x0000D1C4
		public string[] AIComment { get; set; }

		// Token: 0x170000D5 RID: 213
		// (get) Token: 0x06000404 RID: 1028 RVA: 0x0000EFCD File Offset: 0x0000D1CD
		// (set) Token: 0x06000405 RID: 1029 RVA: 0x0000EFD5 File Offset: 0x0000D1D5
		public string[] AOComment { get; set; }

		// Token: 0x170000D6 RID: 214
		// (get) Token: 0x06000406 RID: 1030 RVA: 0x0000EFDE File Offset: 0x0000D1DE
		// (set) Token: 0x06000407 RID: 1031 RVA: 0x0000EFE6 File Offset: 0x0000D1E6
		public string[] GIComment { get; set; }

		// Token: 0x170000D7 RID: 215
		// (get) Token: 0x06000408 RID: 1032 RVA: 0x0000EFEF File Offset: 0x0000D1EF
		// (set) Token: 0x06000409 RID: 1033 RVA: 0x0000EFF7 File Offset: 0x0000D1F7
		public string[] GOComment { get; set; }

		// Token: 0x170000D8 RID: 216
		// (get) Token: 0x0600040A RID: 1034 RVA: 0x0000F000 File Offset: 0x0000D200
		// (set) Token: 0x0600040B RID: 1035 RVA: 0x0000F008 File Offset: 0x0000D208
		public string[] STRREGComment { get; set; }

		// Token: 0x170000D9 RID: 217
		// (get) Token: 0x0600040C RID: 1036 RVA: 0x0000F011 File Offset: 0x0000D211
		// (set) Token: 0x0600040D RID: 1037 RVA: 0x0000F019 File Offset: 0x0000D219
		public string[] STRREG_COMMENT_Comment { get; set; }

		/// <summary>
		/// 从原始的数据内容加载数据
		/// </summary>
		/// <param name="content">原始的内容</param>
		// Token: 0x0600040E RID: 1038 RVA: 0x0000F024 File Offset: 0x0000D224
		public void LoadByContent(byte[] content)
		{
			IByteTransform byteTransform = new RegularByteTransform();
			Encoding encoding;
			try
			{
				encoding = Encoding.GetEncoding("shift_jis", EncoderFallback.ReplacementFallback, new DecoderReplacementFallback());
			}
			catch
			{
				encoding = Encoding.UTF8;
			}
			string[] fanucCmds = FanucHelper.GetFanucCmds();
			int[] array = new int[fanucCmds.Length - 1];
			int[] array2 = new int[fanucCmds.Length - 1];
			for (int i = 1; i < fanucCmds.Length; i++)
			{
				MatchCollection matchCollection = Regex.Matches(fanucCmds[i], "[0-9]+");
				array[i - 1] = (int.Parse(matchCollection[0].Value) - 1) * 2;
				array2[i - 1] = int.Parse(matchCollection[1].Value) * 2;
			}
			this.AlarmList = FanucData.GetFanucAlarmArray(byteTransform, content, array[0], 5, encoding);
			this.AlarmCurrent = FanucAlarm.PraseFrom(byteTransform, content, array[1], encoding);
			this.AlarmPassword = FanucAlarm.PraseFrom(byteTransform, content, array[2], encoding);
			this.CurrentPose = FanucPose.PraseFrom(byteTransform, content, array[3]);
			this.CurrentPoseUF = FanucPose.PraseFrom(byteTransform, content, array[4]);
			this.CurrentPose2 = FanucPose.PraseFrom(byteTransform, content, array[5]);
			this.CurrentPose3 = FanucPose.PraseFrom(byteTransform, content, array[6]);
			this.CurrentPose4 = FanucPose.PraseFrom(byteTransform, content, array[7]);
			this.CurrentPose5 = FanucPose.PraseFrom(byteTransform, content, array[8]);
			this.Task = FanucTask.PraseFrom(byteTransform, content, array[9], encoding);
			this.TaskIgnoreMacro = FanucTask.PraseFrom(byteTransform, content, array[10], encoding);
			this.TaskIgnoreKarel = FanucTask.PraseFrom(byteTransform, content, array[11], encoding);
			this.TaskIgnoreMacroKarel = FanucTask.PraseFrom(byteTransform, content, array[12], encoding);
			this.PosRegGP1 = FanucData.GetFanucPoseArray(byteTransform, content, array[13], 10, encoding);
			this.PosRegGP2 = FanucData.GetFanucPoseArray(byteTransform, content, array[14], 4, encoding);
			this.PosRegGP3 = FanucData.GetFanucPoseArray(byteTransform, content, array[15], 10, encoding);
			this.PosRegGP4 = FanucData.GetFanucPoseArray(byteTransform, content, array[16], 10, encoding);
			this.PosRegGP5 = FanucData.GetFanucPoseArray(byteTransform, content, array[17], 10, encoding);
			this.FAST_CLOCK = BitConverter.ToInt32(content, array[18]);
			this.Timer10_TIMER_VAL = BitConverter.ToInt32(content, array[19]);
			this.MOR_GRP_CURRENT_ANG = BitConverter.ToSingle(content, array[20]);
			this.DUTY_TEMP = BitConverter.ToSingle(content, array[21]);
			this.TIMER10_COMMENT = encoding.GetString(content, array[22], 80).Trim(new char[1]);
			this.TIMER2_COMMENT = encoding.GetString(content, array[23], 80).Trim(new char[1]);
			this.MNUTOOL1_1 = FanucPose.PraseFrom(byteTransform, content, array[24]);
			this.HTTPKCL_CMDS = encoding.GetString(content, array[25], 80).Trim(new char[1]);
			this.NumReg1 = byteTransform.TransInt32(content, array[26], 5);
			this.NumReg2 = byteTransform.TransSingle(content, array[27], 5);
			this.DataPosRegMG = new FanucPose[10];
			for (int j = 0; j < this.DataPosRegMG.Length; j++)
			{
				this.DataPosRegMG[j] = new FanucPose();
				this.DataPosRegMG[j].Xyzwpr = byteTransform.TransSingle(content, array[29] + j * 50, 9);
				this.DataPosRegMG[j].Config = FanucPose.TransConfigStringArray(byteTransform.TransInt16(content, array[29] + 36 + j * 50, 7));
				this.DataPosRegMG[j].Joint = byteTransform.TransSingle(content, array[30] + j * 36, 9);
			}
			this.DIComment = FanucData.GetStringArray(content, array[31], 80, 3, encoding);
			this.DOComment = FanucData.GetStringArray(content, array[32], 80, 3, encoding);
			this.RIComment = FanucData.GetStringArray(content, array[33], 80, 3, encoding);
			this.ROComment = FanucData.GetStringArray(content, array[34], 80, 3, encoding);
			this.UIComment = FanucData.GetStringArray(content, array[35], 80, 3, encoding);
			this.UOComment = FanucData.GetStringArray(content, array[36], 80, 3, encoding);
			this.SIComment = FanucData.GetStringArray(content, array[37], 80, 3, encoding);
			this.SOComment = FanucData.GetStringArray(content, array[38], 80, 3, encoding);
			this.WIComment = FanucData.GetStringArray(content, array[39], 80, 3, encoding);
			this.WOComment = FanucData.GetStringArray(content, array[40], 80, 3, encoding);
			this.WSIComment = FanucData.GetStringArray(content, array[41], 80, 3, encoding);
			this.AIComment = FanucData.GetStringArray(content, array[42], 80, 3, encoding);
			this.AOComment = FanucData.GetStringArray(content, array[43], 80, 3, encoding);
			this.GIComment = FanucData.GetStringArray(content, array[44], 80, 3, encoding);
			this.GOComment = FanucData.GetStringArray(content, array[45], 80, 3, encoding);
			this.STRREGComment = FanucData.GetStringArray(content, array[46], 80, 3, encoding);
			this.STRREG_COMMENT_Comment = FanucData.GetStringArray(content, array[47], 80, 3, encoding);
			this.isIni = true;
		}

		/// <inheritdoc />
		// Token: 0x0600040F RID: 1039 RVA: 0x0000F530 File Offset: 0x0000D730
		public override string ToString()
		{
			bool flag = !this.isIni;
			string result;
			if (flag)
			{
				result = "NULL";
			}
			else
			{
				StringBuilder stringBuilder = new StringBuilder();
				FanucData.AppendStringBuilder(stringBuilder, "AlarmList", Enumerable.ToArray<string>(Enumerable.Select<FanucAlarm, string>(this.AlarmList, (FanucAlarm m) => m.ToString())));
				FanucData.AppendStringBuilder(stringBuilder, "AlarmCurrent", this.AlarmCurrent.ToString());
				FanucData.AppendStringBuilder(stringBuilder, "AlarmPassword", this.AlarmPassword.ToString());
				FanucData.AppendStringBuilder(stringBuilder, "CurrentPose", this.CurrentPose.ToString());
				FanucData.AppendStringBuilder(stringBuilder, "CurrentPoseUF", this.CurrentPoseUF.ToString());
				FanucData.AppendStringBuilder(stringBuilder, "CurrentPose2", this.CurrentPose2.ToString());
				FanucData.AppendStringBuilder(stringBuilder, "CurrentPose3", this.CurrentPose3.ToString());
				FanucData.AppendStringBuilder(stringBuilder, "CurrentPose4", this.CurrentPose4.ToString());
				FanucData.AppendStringBuilder(stringBuilder, "CurrentPose5", this.CurrentPose5.ToString());
				FanucData.AppendStringBuilder(stringBuilder, "Task", this.Task.ToString());
				FanucData.AppendStringBuilder(stringBuilder, "TaskIgnoreMacro", this.TaskIgnoreMacro.ToString());
				FanucData.AppendStringBuilder(stringBuilder, "TaskIgnoreKarel", this.TaskIgnoreKarel.ToString());
				FanucData.AppendStringBuilder(stringBuilder, "TaskIgnoreMacroKarel", this.TaskIgnoreMacroKarel.ToString());
				FanucData.AppendStringBuilder(stringBuilder, "PosRegGP1", Enumerable.ToArray<string>(Enumerable.Select<FanucPose, string>(this.PosRegGP1, (FanucPose m) => m.ToString())));
				FanucData.AppendStringBuilder(stringBuilder, "PosRegGP2", Enumerable.ToArray<string>(Enumerable.Select<FanucPose, string>(this.PosRegGP2, (FanucPose m) => m.ToString())));
				FanucData.AppendStringBuilder(stringBuilder, "PosRegGP3", Enumerable.ToArray<string>(Enumerable.Select<FanucPose, string>(this.PosRegGP3, (FanucPose m) => m.ToString())));
				FanucData.AppendStringBuilder(stringBuilder, "PosRegGP4", Enumerable.ToArray<string>(Enumerable.Select<FanucPose, string>(this.PosRegGP4, (FanucPose m) => m.ToString())));
				FanucData.AppendStringBuilder(stringBuilder, "PosRegGP5", Enumerable.ToArray<string>(Enumerable.Select<FanucPose, string>(this.PosRegGP5, (FanucPose m) => m.ToString())));
				FanucData.AppendStringBuilder(stringBuilder, "FAST_CLOCK", this.FAST_CLOCK.ToString());
				FanucData.AppendStringBuilder(stringBuilder, "Timer10_TIMER_VAL", this.Timer10_TIMER_VAL.ToString());
				FanucData.AppendStringBuilder(stringBuilder, "MOR_GRP_CURRENT_ANG", this.MOR_GRP_CURRENT_ANG.ToString());
				FanucData.AppendStringBuilder(stringBuilder, "DUTY_TEMP", this.DUTY_TEMP.ToString());
				FanucData.AppendStringBuilder(stringBuilder, "TIMER10_COMMENT", this.TIMER10_COMMENT.ToString());
				FanucData.AppendStringBuilder(stringBuilder, "TIMER2_COMMENT", this.TIMER2_COMMENT.ToString());
				FanucData.AppendStringBuilder(stringBuilder, "MNUTOOL1_1", this.MNUTOOL1_1.ToString());
				FanucData.AppendStringBuilder(stringBuilder, "HTTPKCL_CMDS", this.HTTPKCL_CMDS.ToString());
				FanucData.AppendStringBuilder(stringBuilder, "NumReg1", SoftBasic.ArrayFormat<int>(this.NumReg1));
				FanucData.AppendStringBuilder(stringBuilder, "NumReg2", SoftBasic.ArrayFormat<float>(this.NumReg2));
				FanucData.AppendStringBuilder(stringBuilder, "DataPosRegMG", Enumerable.ToArray<string>(Enumerable.Select<FanucPose, string>(this.DataPosRegMG, (FanucPose m) => m.ToString())));
				FanucData.AppendStringBuilder(stringBuilder, "DIComment", SoftBasic.ArrayFormat<string>(this.DIComment));
				FanucData.AppendStringBuilder(stringBuilder, "DOComment", SoftBasic.ArrayFormat<string>(this.DOComment));
				FanucData.AppendStringBuilder(stringBuilder, "RIComment", SoftBasic.ArrayFormat<string>(this.RIComment));
				FanucData.AppendStringBuilder(stringBuilder, "ROComment", SoftBasic.ArrayFormat<string>(this.ROComment));
				FanucData.AppendStringBuilder(stringBuilder, "UIComment", SoftBasic.ArrayFormat<string>(this.UIComment));
				FanucData.AppendStringBuilder(stringBuilder, "UOComment", SoftBasic.ArrayFormat<string>(this.UOComment));
				FanucData.AppendStringBuilder(stringBuilder, "SIComment", SoftBasic.ArrayFormat<string>(this.SIComment));
				FanucData.AppendStringBuilder(stringBuilder, "SOComment", SoftBasic.ArrayFormat<string>(this.SOComment));
				FanucData.AppendStringBuilder(stringBuilder, "WIComment", SoftBasic.ArrayFormat<string>(this.WIComment));
				FanucData.AppendStringBuilder(stringBuilder, "WOComment", SoftBasic.ArrayFormat<string>(this.WOComment));
				FanucData.AppendStringBuilder(stringBuilder, "WSIComment", SoftBasic.ArrayFormat<string>(this.WSIComment));
				FanucData.AppendStringBuilder(stringBuilder, "AIComment", SoftBasic.ArrayFormat<string>(this.AIComment));
				FanucData.AppendStringBuilder(stringBuilder, "AOComment", SoftBasic.ArrayFormat<string>(this.AOComment));
				FanucData.AppendStringBuilder(stringBuilder, "GIComment", SoftBasic.ArrayFormat<string>(this.GIComment));
				FanucData.AppendStringBuilder(stringBuilder, "GOComment", SoftBasic.ArrayFormat<string>(this.GOComment));
				FanucData.AppendStringBuilder(stringBuilder, "STRREGComment", SoftBasic.ArrayFormat<string>(this.STRREGComment));
				FanucData.AppendStringBuilder(stringBuilder, "STRREG_COMMENT_Comment", SoftBasic.ArrayFormat<string>(this.STRREG_COMMENT_Comment));
				result = stringBuilder.ToString();
			}
			return result;
		}

		/// <summary>
		/// 从字节数组解析出fanuc的数据信息
		/// </summary>
		/// <param name="content">原始的字节数组</param>
		/// <returns>fanuc数据</returns>
		// Token: 0x06000410 RID: 1040 RVA: 0x0000FA94 File Offset: 0x0000DC94
		public static OperateResult<FanucData> PraseFrom(byte[] content)
		{
			FanucData fanucData = new FanucData();
			fanucData.LoadByContent(content);
			return OperateResult.CreateSuccessResult<FanucData>(fanucData);
		}

		// Token: 0x06000411 RID: 1041 RVA: 0x0000FABA File Offset: 0x0000DCBA
		private static void AppendStringBuilder(StringBuilder sb, string name, string value)
		{
			FanucData.AppendStringBuilder(sb, name, new string[]
			{
				value
			});
		}

		// Token: 0x06000412 RID: 1042 RVA: 0x0000FAD0 File Offset: 0x0000DCD0
		private static void AppendStringBuilder(StringBuilder sb, string name, string[] values)
		{
			sb.Append(name);
			sb.Append(":");
			bool flag = values.Length > 1;
			if (flag)
			{
				sb.Append(Environment.NewLine);
			}
			for (int i = 0; i < values.Length; i++)
			{
				sb.Append(values[i]);
				sb.Append(Environment.NewLine);
			}
			bool flag2 = values.Length > 1;
			if (flag2)
			{
				sb.Append(Environment.NewLine);
			}
		}

		// Token: 0x06000413 RID: 1043 RVA: 0x0000FB48 File Offset: 0x0000DD48
		private static string[] GetStringArray(byte[] content, int index, int length, int arraySize, Encoding encoding)
		{
			string[] array = new string[arraySize];
			for (int i = 0; i < arraySize; i++)
			{
				array[i] = encoding.GetString(content, index + length * i, length).TrimEnd(new char[1]);
			}
			return array;
		}

		// Token: 0x06000414 RID: 1044 RVA: 0x0000FB90 File Offset: 0x0000DD90
		private static FanucPose[] GetFanucPoseArray(IByteTransform byteTransform, byte[] content, int index, int arraySize, Encoding encoding)
		{
			FanucPose[] array = new FanucPose[arraySize];
			for (int i = 0; i < arraySize; i++)
			{
				array[i] = FanucPose.PraseFrom(byteTransform, content, index + i * 100);
			}
			return array;
		}

		// Token: 0x06000415 RID: 1045 RVA: 0x0000FBCC File Offset: 0x0000DDCC
		private static FanucAlarm[] GetFanucAlarmArray(IByteTransform byteTransform, byte[] content, int index, int arraySize, Encoding encoding)
		{
			FanucAlarm[] array = new FanucAlarm[arraySize];
			for (int i = 0; i < arraySize; i++)
			{
				array[i] = FanucAlarm.PraseFrom(byteTransform, content, index + 200 * i, encoding);
			}
			return array;
		}

		// Token: 0x04000127 RID: 295
		private bool isIni = false;
	}
}
